package com.yu.yuapi.model.enums;

public enum InterfaceStatuesEnum {
    ONLINE("启用", 1),
    OFFLINE("禁用", 0);
    private final String text;
    private final int value;

    InterfaceStatuesEnum(String text, int value) {
        this.text = text;
        this.value = value;
    }

    public static String getByValue(int value) {
        for (InterfaceStatuesEnum status : InterfaceStatuesEnum.values()) {
            if (status.getValue() == value) {
                return status.getText();
            }
        }
        return null;
    }

    public int getValue() {
        return this.value;
    }

    public String getText() {
        return this.text;
    }
}
